/*
 Navicat Premium Data Transfer

 Source Server         : 10.122.18.34-测试
 Source Server Type    : SQL Server
 Source Server Version : 13006419
 Source Host           : 10.122.18.34:1433
 Source Catalog        : SVWASTMS
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 13006419
 File Encoding         : 65001

 Date: 26/11/2024 15:42:45
*/


-- ----------------------------
-- Table structure for TI_TMS_SAPDNDELETEROW
-- ----------------------------
/* 注释掉删表操作以防服务器现有表被删除
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TI_TMS_SAPDNDELETEROW]') AND type IN ('U'))
	DROP TABLE [dbo].[TI_TMS_SAPDNDELETEROW]
GO
*/

CREATE TABLE [dbo].[TI_TMS_SAPDNDELETEROW] (
  [TI_ID] int  IDENTITY(1,1) NOT NULL,
  [DELIVERY_NO] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [DELIVERY_LINE] nvarchar(6) COLLATE Chinese_PRC_CI_AS  NULL,
  [SO_NO] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [SO_LINE] nvarchar(6) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATEDATE] datetime  NULL
)
GO

ALTER TABLE [dbo].[TI_TMS_SAPDNDELETEROW] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'交货单号',
'SCHEMA', N'dbo',
'TABLE', N'TI_TMS_SAPDNDELETEROW',
'COLUMN', N'DELIVERY_NO'
GO

EXEC sp_addextendedproperty
'MS_Description', N'交货单行号',
'SCHEMA', N'dbo',
'TABLE', N'TI_TMS_SAPDNDELETEROW',
'COLUMN', N'DELIVERY_LINE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'销售订单号',
'SCHEMA', N'dbo',
'TABLE', N'TI_TMS_SAPDNDELETEROW',
'COLUMN', N'SO_NO'
GO

EXEC sp_addextendedproperty
'MS_Description', N'销售订单行号',
'SCHEMA', N'dbo',
'TABLE', N'TI_TMS_SAPDNDELETEROW',
'COLUMN', N'SO_LINE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'TI_TMS_SAPDNDELETEROW',
'COLUMN', N'CREATEDATE'
GO


-- ----------------------------
-- Auto increment value for TI_TMS_SAPDNDELETEROW
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[TI_TMS_SAPDNDELETEROW]', RESEED, 412)
GO


-- ----------------------------
-- Primary Key structure for table TI_TMS_SAPDNDELETEROW
-- ----------------------------
ALTER TABLE [dbo].[TI_TMS_SAPDNDELETEROW] ADD CONSTRAINT [PK__TI_TMS_S__4AFCCA501EFEE715] PRIMARY KEY CLUSTERED ([TI_ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO




/*
 Navicat Premium Data Transfer

 Source Server         : 10.122.18.34-测试
 Source Server Type    : SQL Server
 Source Server Version : 13006419
 Source Host           : 10.122.18.34:1433
 Source Catalog        : SVWASTMS
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 13006419
 File Encoding         : 65001

 Date: 26/11/2024 15:40:24
*/


-- ----------------------------
-- Table structure for TI_TMS_SAPDNUPDATE
-- ----------------------------
/*注释掉删表操作以防服务器现有表被删除
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TI_TMS_SAPDNUPDATE]') AND type IN ('U'))
	DROP TABLE [dbo].[TI_TMS_SAPDNUPDATE]
GO
*/

CREATE TABLE [dbo].[TI_TMS_SAPDNUPDATE] (
  [TI_ID] bigint  IDENTITY(1,1) NOT NULL,
  [OBJECTID] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [CHANGENR] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATEDATE] datetime  NULL,
  [TABKEY] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FNAME] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [VALUE_NEW] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[TI_TMS_SAPDNUPDATE] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Auto increment value for TI_TMS_SAPDNUPDATE
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[TI_TMS_SAPDNUPDATE]', RESEED, 9063)
GO


-- ----------------------------
-- Primary Key structure for table TI_TMS_SAPDNUPDATE
-- ----------------------------
ALTER TABLE [dbo].[TI_TMS_SAPDNUPDATE] ADD CONSTRAINT [PK__TI_TMS_S__4AFCCA50D5546F6C_copy1] PRIMARY KEY CLUSTERED ([TI_ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO



/*
 Navicat Premium Data Transfer

 Source Server         : 10.122.18.34-测试
 Source Server Type    : SQL Server
 Source Server Version : 13006419
 Source Host           : 10.122.18.34:1433
 Source Catalog        : SVWASTMS
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 13006419
 File Encoding         : 65001

 Date: 26/11/2024 15:41:21
*/


-- ----------------------------
-- Table structure for TL_TMS_POLOGISTICSROW_BK
-- ----------------------------
/*注释掉删表操作以防服务器现有表被删除
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TL_TMS_POLOGISTICSROW_BK]') AND type IN ('U'))
	DROP TABLE [dbo].[TL_TMS_POLOGISTICSROW_BK]
GO
*/

CREATE TABLE [dbo].[TL_TMS_POLOGISTICSROW_BK] (
  [POLOG_ID] bigint  NOT NULL,
  [PO_NO] nvarchar(30) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [PO_LINE] nvarchar(6) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [PO_TYPE] nvarchar(1) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [ISSLUGFLOW] bit  NULL,
  [DELIVERY_NO] nvarchar(10) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [DELIVERY_LINE] nvarchar(6) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NULL,
  [DELIVERY_QTY] decimal(18,3)  NULL,
  [DN_CREATEDATE] datetime  NULL,
  [BILL_NO] nvarchar(10) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [BILL_LINE] nvarchar(6) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [BILL_CREATEDATE] datetime  NULL,
  [TIMESTAMP] datetime  NULL,
  [CASE_DESTPLANT] nvarchar(4) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT '' NULL,
  [CASE_DESTLOCATION] nvarchar(4) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [CASE_CONNECTDATE] datetime  NULL,
  [SHIPPING_ORDER_NO1] nvarchar(10) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [ARRIVE_CONFIRM_DATETIME1] datetime  NULL,
  [SHIPPING_ENDDATE1] datetime  NULL,
  [CASEREQUIRED_ARRIVE_DATETIME] datetime  NULL,
  [RDC_NO2] nvarchar(4) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [SAP_PLANT2] nvarchar(5) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [SAP_LOCATION2] nvarchar(4) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [WAREHOUSE_NO2] nvarchar(5) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [SHIPPING_ORDER_NO2] nvarchar(10) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [SHIPPING_ENDDATE2] datetime  NULL,
  [SHIPPING_TYPE2] tinyint  NULL,
  [KPI_ARRIVETIME2] datetime  NULL,
  [OUTSTOCK_TIME2] datetime  NULL,
  [DELVHUB_ETIME2] datetime  NULL,
  [DELVHUB_LTIME2] datetime  NULL,
  [EXPRESS_NUMBER] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [ARRIVE_CONFIRM_DATETIME2] datetime  NULL,
  [POLOG_STATUS] int DEFAULT 0 NULL,
  [POLOG_ISEND] int DEFAULT 0 NULL,
  [CHANGE_TIMES] int DEFAULT '0' NULL,
  [CREATEUSER] nvarchar(20) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [CREATEDATE] datetime  NULL,
  [MODIFYUSER] nvarchar(20) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
  [MODIFYDATE] datetime  NULL,
  [POEND_STATUS] smallint  NULL,
  [POISEND_STATUS] smallint  NULL
)
GO

ALTER TABLE [dbo].[TL_TMS_POLOGISTICSROW_BK] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'采购订单号',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_POLOGISTICSROW_BK',
'COLUMN', N'PO_NO'
GO

EXEC sp_addextendedproperty
'MS_Description', N'采购订单行号',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_POLOGISTICSROW_BK',
'COLUMN', N'PO_LINE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'到达中转站时间',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_POLOGISTICSROW_BK',
'COLUMN', N'DELVHUB_ETIME2'
GO

EXEC sp_addextendedproperty
'MS_Description', N'离开中转站时间',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_POLOGISTICSROW_BK',
'COLUMN', N'DELVHUB_LTIME2'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_POLOGISTICSROW_BK',
'COLUMN', N'CREATEUSER'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_POLOGISTICSROW_BK',
'COLUMN', N'CREATEDATE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_POLOGISTICSROW_BK',
'COLUMN', N'MODIFYUSER'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_POLOGISTICSROW_BK',
'COLUMN', N'MODIFYDATE'
GO


-- ----------------------------
-- Indexes structure for table TL_TMS_POLOGISTICSROW_BK
-- ----------------------------
CREATE NONCLUSTERED INDEX [IDX_TL_TMS_POLOGISTICSROW_RDC_NO2_POLOG_STATUS]
ON [dbo].[TL_TMS_POLOGISTICSROW_BK] (
  [ISSLUGFLOW] ASC,
  [RDC_NO2] ASC,
  [POLOG_STATUS] ASC,
  [POLOG_ISEND] ASC
)
INCLUDE ([POLOG_ID], [PO_NO], [PO_LINE], [PO_TYPE], [DELIVERY_NO], [DELIVERY_LINE], [DELIVERY_QTY], [DN_CREATEDATE], [BILL_NO], [BILL_LINE], [BILL_CREATEDATE], [TIMESTAMP], [CASE_DESTPLANT], [CASE_DESTLOCATION], [CASE_CONNECTDATE], [SHIPPING_ORDER_NO1], [ARRIVE_CONFIRM_DATETIME1], [SHIPPING_ENDDATE1], [CASEREQUIRED_ARRIVE_DATETIME], [SAP_PLANT2], [SAP_LOCATION2], [WAREHOUSE_NO2], [SHIPPING_ORDER_NO2], [SHIPPING_ENDDATE2], [SHIPPING_TYPE2], [KPI_ARRIVETIME2], [OUTSTOCK_TIME2], [DELVHUB_ETIME2], [DELVHUB_LTIME2], [EXPRESS_NUMBER], [ARRIVE_CONFIRM_DATETIME2], [CHANGE_TIMES], [CREATEUSER], [CREATEDATE], [MODIFYUSER], [MODIFYDATE])
GO

CREATE NONCLUSTERED INDEX [IDX_TMS_POLOGISTICSROW_PONO_POLINE]
ON [dbo].[TL_TMS_POLOGISTICSROW_BK] (
  [PO_NO] ASC,
  [PO_LINE] ASC
)
GO

CREATE NONCLUSTERED INDEX [IX_TL_TMS_POLOGISTICSROW_DELIVERY_NO_DELIVERY_LINE]
ON [dbo].[TL_TMS_POLOGISTICSROW_BK] (
  [DELIVERY_NO] ASC,
  [DELIVERY_LINE] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table TL_TMS_POLOGISTICSROW_BK
-- ----------------------------
ALTER TABLE [dbo].[TL_TMS_POLOGISTICSROW_BK] ADD CONSTRAINT [PK__TL_TMS_P__6E15A436880ADC08] PRIMARY KEY CLUSTERED ([POLOG_ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO



/*
 Navicat Premium Data Transfer

 Source Server         : 10.122.18.34-测试
 Source Server Type    : SQL Server
 Source Server Version : 13006419
 Source Host           : 10.122.18.34:1433
 Source Catalog        : SVWASTMS
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 13006419
 File Encoding         : 65001

 Date: 26/11/2024 15:39:13
*/


-- ----------------------------
-- Table structure for TL_TMS_SYNCUPDATE
-- ----------------------------
/*注释掉删表操作以防服务器现有表被删除
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TL_TMS_SYNCUPDATE]') AND type IN ('U'))
	DROP TABLE [dbo].[TL_TMS_SYNCUPDATE]
GO
*/

CREATE TABLE [dbo].[TL_TMS_SYNCUPDATE] (
  [CHANGENR] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATEUSER] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATEDATE] datetime  NULL,
  [MODIFYUSER] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [MODIFYDATE] datetime  NULL,
  [TL_NO] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NOT NULL
)
GO

ALTER TABLE [dbo].[TL_TMS_SYNCUPDATE] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_SYNCUPDATE',
'COLUMN', N'CREATEUSER'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_SYNCUPDATE',
'COLUMN', N'CREATEDATE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_SYNCUPDATE',
'COLUMN', N'MODIFYUSER'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'TL_TMS_SYNCUPDATE',
'COLUMN', N'MODIFYDATE'
GO


-- ----------------------------
-- Primary Key structure for table TL_TMS_SYNCUPDATE
-- ----------------------------
ALTER TABLE [dbo].[TL_TMS_SYNCUPDATE] ADD CONSTRAINT [PK_TL_TMS_SYNCDELETE_copy1] PRIMARY KEY CLUSTERED ([TL_NO])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

